#ifndef _EVENT_H
#define _EVENT_H

#include <stdbool.h>

typedef struct {
    bool bAutoReset;
    bool bIsSet;
} event_t;

#define  RESET_AUTO     false
#define  RESET_MANUAL   true
    
#define SET_EVENT(__EVENT)                          set_event(__EVENT)
#define WAIT_EVENT(_EVENT)                          wait_event(_EVENT)
#define RESET_EVENT(_EVENT)                         reset_event(_EVENT)
#define INIT_EVENT(_EVENT, _INIT_VALUE, _MANUAL)    init_event(_EVENT, _INIT_VALUE, _MANUAL)

extern bool wait_event(event_t *ptEvent);
extern bool reset_event(event_t *ptEvent);
extern bool init_event(event_t *ptEvent, bool bValue, bool bManual);
extern bool set_event(event_t *ptEvent);
#endif
